package cn.sytton.taffecloud.service.log.service.impl;

import cn.sytton.taffecloud.common.db.model.PageParam;
import cn.sytton.taffecloud.common.servlet.service.BaseService;
import cn.sytton.taffecloud.common.model.log.ApiLogEntity;
import cn.sytton.taffecloud.service.log.mapper.ApiLogMapper;
import cn.sytton.taffecloud.service.log.service.IApiLogService;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * Api访问日志服务层实现
 *
 * @author skyrock
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class ApiLogService extends BaseService<ApiLogEntity> implements IApiLogService {

    @Resource
    private ApiLogMapper apiLogMapper;

    @Override
    public PageInfo<ApiLogEntity> findListPage(PageParam pp) {
        setPageParams(pp);
        return new PageInfo<>(apiLogMapper.findList(pp.getParams()));
    }
}
